package com.tianji.learning.service;

import com.tianji.common.domain.dto.PageDTO;
import com.tianji.common.domain.query.PageQuery;
import com.tianji.learning.entity.LearningLesson;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tianji.learning.vo.LearningLessonVO;
import com.tianji.learning.vo.LearningPlanPageVO;

import java.util.List;

/**
 * <p>
 * 学生课程表 服务类
 * </p>
 *
 * @author author
 * @since 2023-05-25
 */
public interface ILearningLessonService extends IService<LearningLesson> {

    /**
     * 下单回调添加课程方法
     */
    void listenLessonPay(Long userId, List<Long> courseIds);

    /**
     * 分页查询
     * @param query
     * @return
     */
    PageDTO<LearningLessonVO> queryMyLessons(PageQuery query);

    /**
     * 查询我的最近学习的课程
     * @param
     * @return
     */
    LearningLessonVO getInfo();

    /**
     * 检验用户是否有播放视频的资格
     * @param courseId
     * @return
     */
    Long isLessonValid(Long courseId);

    /**
     * 查询用户是否有改课程
     * @param courseId
     * @return
     */
    LearningLesson getAuthority(Long courseId);

    /**
     * 查询课程学习人数
     * @param courseId
     * @return
     */
    Integer countLearningLessonByCourse(Long courseId);

    /**
     * 创建学习计划
     * @param courseId
     * @param freq
     */
    void createLearningPlan(Long courseId, Integer freq);

    /**
     * 查询我的学习计划
     * @param query
     * @return
     */
    LearningPlanPageVO queryMyPlans(PageQuery query);
}
